<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<style>
/* 子代 */
#a>p{
    color: hotpink
}
/* 后代 */
#b p{
    color: hotpink
}
</style>

<body>
    <div id="a">
        <p>篮球</p>
        <p>足球</p>
        <span>
            <p>乒乓球</p>
            <p>羽毛球</p>
        </span>
    </div>

    <hr/>
    <div id="b">
            <p>篮球</p>
            <p>足球</p>
            <span>
                <p>乒乓球</p>
                <p>羽毛球</p>
            </span>
        </div>
</body>
</html>